package com.pureut.production.api;

import com.pureut.common.core.constant.ServiceNameConstants;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.production.api.domain.FeedRecord;
import com.pureut.production.api.domain.LineStock;
import com.pureut.production.api.domain.PublicScheduling;
import com.pureut.production.api.domain.vo.*;
import com.pureut.production.api.factory.RemoteProductionFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 生产服务
 * 
 * @author hl
 */
@FeignClient(contextId = "FeignProductionService", value = ServiceNameConstants.PUREUT_PROPERTY, fallbackFactory = RemoteProductionFallbackFactory.class)
public interface FeignProductionService
{
    /**
     * 新增水刺执行单
     *
     * @param PublicScheduling 请求来源
     * @return 结果
     */
    @PostMapping("/spunlaceOrder/addOrderCut")
    public int addOrderCutScheduling(@RequestBody PublicScheduling PublicScheduling);

    /**
     * 根据物料号码获取肥料管理数据（fegin调用）
     */
    @GetMapping("/wasteTube/getWasteData")
    public AjaxResult getWasteData(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据物料号码获取线边库存数据（fegin调用）
     */
    @GetMapping("/lineStock/getLineStockData")
    public AjaxResult getLineStockData(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据物料号码获取明细数据(fegin调用)
     */
    @GetMapping("/spunlaceOutputDetail/getSpunlaceDetail")
    public AjaxResult getSpunlaceDetail(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据产品号码获取成品称重详情(feign调用)
     */
    @GetMapping("/weighing-finished-material-product/getWeighingFinishedData")
    public AjaxResult getWeighingFinishedData(@RequestParam("materialNumber") String materialNumber);


    @PostMapping("/spunlaceOrder/editQualityOrder")
    public boolean editQualityOrder(@RequestBody EditQualityOrderVo editQualityOrderVo) throws Exception;

    /**
     * 查询线边仓数据（冻结列表查询 feign调用）
     * @param lineStockVo
     * @return
     */
    @PostMapping("/lineStock/getLineStockList")
    public AjaxResult getLineStockList(@RequestBody LineStockVo lineStockVo);

    /**
     * 批量修改线边仓数据状态 feign调用
     */
    @PostMapping("/lineStock/updateLineStockStatus")
    public AjaxResult updateLineStockStatus(@RequestBody UpdateLineStockStatusVo updateLineStockStatusVo);

    /**
     * 分切制令单明细列表（feign调用）
     */
    @GetMapping("/cut-orders-document-detail/detailList")
    public AjaxResult detailList(@RequestParam("documentNum") String documentNum);

    /**
     * 通过物料号码修改线边仓物料冻结状态
     */
    @GetMapping("/lineStock/updateStatusThaw")
    public void updateStatusThaw(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据制令单号获取明细数据(fegin调用)
     */
    @GetMapping("/spunlaceOutputDetail/getDetailList")
    public AjaxResult getDetailList(@RequestParam("orderNum") String orderNum);

    /**
     * 查询工艺卡编码（远程调用 产品追溯页面）
     */
    @GetMapping("/spunlaceOrder/getProcessCardCoding")
    public AjaxResult getProcessCardCoding(@RequestParam("wsiConnectNum") String wsiConnectNum);

    /**
     * 查询小卷关联的母卷（远程调用 产品追溯）
     */
    @GetMapping("/roll-packing/selectMasterVolumeNumberList")
    public AjaxResult selectMasterVolumeNumberList(@RequestParam("masterVolumeNumber") String masterVolumeNumber);

    /**
     * 根据小卷号码查询小卷信息（远程调用 产品追溯）
     */
    @GetMapping("/roll-packing/getTraceabilityRollInfo")
    public AjaxResult getTraceabilityRollInfo(@RequestParam("materialNumber") String materialNumber);

    /***
     * 新增线边库存
     */
    @PostMapping("/lineStock/addLineStock")
    public AjaxResult addLineStock(@RequestBody LineStock lineStock);

    /**
     * 新增投料记录
     */
    @PostMapping("/feedRecord/addFeed")
    public AjaxResult add(@RequestBody FeedRecord feedRecord);

    /**
     * 批量新增线边仓数据
     */
    @PostMapping("/lineStock/addBatchLineStock")
    public AjaxResult addBatchLineStock(@RequestBody List<LineStock> list);

    /**
     * 品质修改水刺物料状态
     * @param updateProductionCheckVo
     * @return
     * @throws Exception
     */
    @PostMapping("/spunlaceOutputDetail/spunlaceUpdateStatus")
    public AjaxResult spunlaceUpdateStatus(@RequestBody UpdateProductionCheckVo updateProductionCheckVo) throws Exception;

    /**
     * 品质修改水刺物料等级
     * @param updateProductionCheckVo
     * @return
     * @throws Exception
     */
    @PostMapping("/spunlaceOutputDetail/spunlaceUpdateGrade")
    public AjaxResult spunlaceUpdateGrade(@RequestBody UpdateProductionCheckVo updateProductionCheckVo) throws Exception;

    /**
     * 删除线边仓数据
     */
    @GetMapping("/lineStock/deleteLineStock")
    public AjaxResult deleteLineStock(@RequestParam("materialNumber") String materialNumber);


    /**
     * 查询母卷是否分切（远程调用 产品追溯）
     */
    @GetMapping("/cut-orders-document-detail/getCutOrdersDocumentInfo")
    public AjaxResult getCutOrdersDocumentInfo(@RequestParam("masterVolumeNumber") String masterVolumeNumber);

    /**
     * 根据班组编码获取班组信息，班长信息及班组成员（设备模块fegin调用）
     */
    @GetMapping("/group/getDataByGroupCode")
    public AjaxResult getDataByGroupCode(@RequestParam("groupCode") String groupCode);

    /**
     * 根据物料号码修改该物料入库时间（fegin调用）
     */
    @GetMapping("/wasteTube/upDateInTime")
    public void upDateInTime(@RequestParam("wasteScrapNumber") String wasteScrapNumber);

    /**
     * 获取投料记录信息
     */
    @GetMapping("/feedRecord/getInfo")
    public boolean getInfo(@RequestParam("moNumber") String moNumber);


    @GetMapping("/upDateOutTime")
    public void upDateOutTime(String wasteScrapNumber);

    /**
     * 修改明细检验状态，检验结果及物料等级(品质审核时候调用)
     */
    @PostMapping("/degreas_output_detail/updateByDegreasOutDetail")
    public AjaxResult updateByDegreasOutDetail(@RequestBody UpdateByDegreasOutDetailVo updateByDegreasOutDetailVo);

    /**
     * 修改明细检验物料等级(品质处理时候调用)
     */
    @PostMapping("/degreas_output_detail/updateByDegreasOutDetailQuality")
    public AjaxResult updateByDegreasOutDetailQuality(@RequestBody UpdateByDegreasOutDetailVo updateByDegreasOutDetailVo);

    /**
     * 根据关联单号查询水刺投料信息
     * @param materialNumber
     * @return
     */
    @GetMapping("/spunlaceOrder/selectSpunlaceOrderInfo")
    public AjaxResult selectSpunlaceOrderInfo(@RequestParam("feedOrderNumber") String materialNumber);

    /**
     * 根据关联单号查询水刺制令单信息
     * @param feedOrderNumber
     * @return
     */
    @GetMapping("/spunlaceOrder/selectDocumentStatusInfo")
    public AjaxResult selectDocumentStatusInfo(@RequestParam("feedOrderNumber") String feedOrderNumber);

    /**
     * 根据关联单号查询脱脂制令单信息
     * @param feedOrderNumber
     * @return
     */
    @GetMapping("/degreas-document/selectDegreasDocumentInfo")
    public AjaxResult selectDegreasDocumentInfo(@RequestParam("feedOrderNumber") String feedOrderNumber);

    /**
     * 验布明细列表
     * @param masterVolumeNumber
     * @return
     */
    @GetMapping("/cloth-inspection-detail/list")
    public AjaxResult list(@RequestParam("masterVolumeNumber") String masterVolumeNumber);

    /**
     * 根据物料号码查询脱脂产出明细详情
     * @param materialNumber
     * @return
     */
    @GetMapping("/degreas_output_detail/selectMaterialNumberInfo")
    public AjaxResult selectMaterialNumberInfo(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据生产计划单号查询水刺制令单数据(生产排程退回调用fegin)
     */
    @GetMapping("/spunlaceOrder/getStatusByPlanNumber")
    public boolean getStatusByPlanNumber(@RequestParam("planNumber") String planNumber);

    /**
     * 根据产品号码获取详情(完工入库 feign调用)
     */
    @GetMapping("/weighing-finished-material-product/getFinishedData")
    public AjaxResult getFinishedData(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据母卷号码查询成品称重详情（产品追溯feign）
     */
    @GetMapping("/weighing-finished-material-product/selectWeighingFinishedMaterialProductList")
    public AjaxResult selectWeighingFinishedMaterialProductList(@RequestParam("masterVolumeNumber") String masterVolumeNumber);

    /**
     * 根据母卷号码查询水刺详情（产品追溯feign）
     */
    @GetMapping("/spunlaceOutputDetail/selectSpunlaceDetailList")
    public AjaxResult selectSpunlaceDetailList(@RequestParam("productionNumber") String productionNumber);

    /**
     *  根据小卷号码查询小卷历史表信息（产品追溯feign）
     */
    @GetMapping("/roll-packing/selectRollPackingHistoryInfo")
    public AjaxResult selectRollPackingHistoryInfo(@RequestParam("smallVolumeNumber") String smallVolumeNumber);

    /**
     *  根据母卷号码查询小卷历史表信息（产品追溯feign）
     */
    @GetMapping("/roll-packing/selectRollPackingHistoryMasterVolumeNumber")
    public AjaxResult selectRollPackingHistoryMasterVolumeNumber(@RequestParam("masterVolumeNumber") String masterVolumeNumber);

    @DeleteMapping("/spunlaceOrder/removeMoNumber")
    public boolean remove(@RequestParam("planNumber") String planNumber);

    /**
     * 查询脱脂产出明细数据
     */
    @GetMapping("/degreas_output_detail/getDetailList")
    public AjaxResult getDegreasOrderDetailList(@RequestParam("degreasOrderNumber") String degreasOrderNumber);

    /**
     * 查询脱脂产出明细数据
     */
    @GetMapping("/degreas_output_detail/selectDetailListMaterialNumber")
    public AjaxResult selectDetailListMaterialNumber(@RequestParam("materialNumber") String materialNumber);

    /**
     * 根据领料单号删除线边仓数据
     * @param wareAlCode
     * @return
     */
    @PostMapping("/lineStock/deleteBatchLineStock")
    public AjaxResult deleteBatchLineStock(@RequestBody String wareAlCode);


    /**
     * 验布明细列表 远程调用 产品追溯
     * @param masterVolumeNumber
     * @return
     */
    @GetMapping("/cloth-inspection-detail/selectDetailLisMasterVolumeNumber")
    public AjaxResult selectDetailLisMasterVolumeNumber(@RequestParam("masterVolumeNumber") String masterVolumeNumber);


    /**
     * 投料明细列表 远程调用 产品追溯
     * @param materialNumber
     * @return
     */
    @GetMapping("/feedRecord/getMaterialNumberInfo")
    public AjaxResult getMaterialNumberInfo(@RequestParam("materialNumber") String materialNumber);

    /**
     * 通过小卷号码查询成品称重信息（产品追溯小卷基础信息feign）
     * @param smallVolumeNumber
     * @return
     */
    @GetMapping("/weighing-finished-material-product/selectBySmallVolumeNumber")
    public AjaxResult selectBySmallVolumeNumber(@RequestParam("smallVolumeNumber") String smallVolumeNumber);
}
